import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random

import sim, main, util, sim_items
from util import *

class NightShroud(sim_items.Armor, sim_items.LightSource):
    def __init__(self):
        bonuses = {
                'evMod': 2,
                'pvMod': 12,
        }

        sim_items.Armor.__init__(self, 
                'night shroud',    # name
                parole.map.AsciiTile('[', colors['Black']), # appearance
                15,          # weight (lbs)
                ['body'],   # slot(s)
                20000,       # energy to wear
                bonuses)
        
        sim_items.LightSource.__init__(self,
                'night shroud',     #name
                50,     # layer
                parole.map.AsciiTile('[', colors['Black']),
                15,  # weight
                7000,   # light energy
                (25, 25, 112),  # light color
                -2.0,    # light intensity
                120000*600000,  # burn time
                showBurnTime=False,                       
                dousable=False,
                litAdjective="gloaming",
                handsNeeded=0, # already takes a hand to ready as shield
                unidDescription="This incredibly hard mail is made from a gloomy metal that you"
                "cannot identify. It devours the light around you.")
        
        self.snuffable = False
        self.startIntensity = self.lightIntensity
        self.startBurnTime = self.burnTime
        main.schedule.add(sim.Event('activate light', main.schedule.time,
            (self,), dests=[self]))
        self.fading = False
        
    def listen(self, event):
        sim_items.Armor.listen(self, event)
        sim_items.LightSource.listen(self, event, superListen=False)
                
#========================================
thingClass = NightShroud 
